package com.atguigu.gulimall.ware.config;

import com.zaxxer.hikari.HikariDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;

import javax.sql.DataSource;

/**
 * @author ming
 * @create 2022/5/11
 * @description:
 */
@Configuration
public class MySeataConfig {
    //@Autowired
    //private DataSourceProperties dataSourceProperties;
    //@Bean
    //public DataSource datasource(DataSourceProperties dataSourceProperties){
    //    HikariDataSource datasource = dataSourceProperties.initializeDataSourceBuilder().type(HikariDataSource.class).build();
    //    if(StringUtils.hasText(dataSourceProperties.getName())){
    //        datasource.setPoolName(dataSourceProperties.getName());
    //    }
    //    return new DataSourceProxy(datasource);
    //
    //}
}
